package com.jyx.framework.utils;

import java.sql.Timestamp;
import java.util.Date;
import java.text.SimpleDateFormat;


public class DateFormat {
    public static String dateToString(Date date){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return simpleDateFormat.format(date);
    }

    public static Timestamp dateToTimestamp(Date date){
        String time = DateFormat.dateToString(date);
        Timestamp timestamp = Timestamp.valueOf(time);
        return timestamp;
    }
}
